package com.book.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.Date;

/**
 * @author Bigboss
 * @create 2024-11-10 15:27
 */
@ApiModel(description = "浏览记录表")
@TableName("browsing_history")
public class BrowsingHistory {

    /**
     * 主键
     */
    @ApiModelProperty(value = "主键")
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    private String id;


    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id")
    private String appUserId;


    /**
     * 书籍id
     */
    private String bookId;


    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;


    /**
     * 浏览对应的书籍信息
     */
    @TableField(exist = false)
    private Book book;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAppUserId() {
        return appUserId;
    }

    public void setAppUserId(String appUserId) {
        this.appUserId = appUserId;
    }

    public String getBookId() {
        return bookId;
    }

    public void setBookId(String bookId) {
        this.bookId = bookId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Book getBook() {
        return book;
    }

    public void setBook(Book book) {
        this.book = book;
    }

    @Override
    public String toString() {
        return "BrowsingHistory{" +
                "id='" + id + '\'' +
                ", appUserId='" + appUserId + '\'' +
                ", bookId='" + bookId + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}
